﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EF
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                using (var db = new  Model1Container())
                {
                    
                   //db.Employees.AddObject(new Employee() { Nama = string.Format("yanuar-{0}",DateTime.Now.ToString("HHmmss")) ,Id=Guid.NewGuid()});
                   var g=Guid.Parse("d1d35a49-8cb1-461d-935d-7bbd5916375a");
                   var r = db.Employees.Single<Employee>(x => x.Id ==g );

                   Console.WriteLine(r.Nama);
                    //r.Nama = "saputra";
                    

                    //db

                    //foreach (var v in r)
                    //{
                    //    Console.WriteLine(v.Id);
                    //}
                        
                    
                   // db.SaveChanges();
                }
                Console.WriteLine("done");
            }
            catch (Exception ex)
            {

                Console.WriteLine(ex.InnerException);
            }
            Console.ReadKey();
            
        }
    }
}
